<template>
    <div>
        <div
                :style="resourceAnimal==true?'color:red':'color:black'"
                @click="change"></div>
    </div>
</template>
<script>
    export default{
        data(){
            return {
                resourceAnimal: false
            }
        },
        methods: {
            change(){
                //层级太深监测不到元素的变化
                this.resourceAnimal = Object.assign([], this.$data.resourceAnimal);
            }
        }
    }

</script>
<style scoped>

</style>